package cn.youruan.demo.mapper;

import cn.youruan.demo.common.R;
import cn.youruan.demo.domain.User;
import cn.youruan.demo.dto.UserDto;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<User>  {
    Integer selectHobbyCount(Long userId);

    void addHobbyRelation(Long userId, Long hobbyId);

    Long selectHobbyIdByUserId(Long userId);

    void deleteHobbyRelation(Long userId,Long hobbyId);


    List<UserDto> sortByHobbyMaxUser();

    List<User> sortByCount();
}
